@extends('layouts.admin')

@section('content')
<!-- Page Heading -->
<h1 class="page-header">
	Category - <small>All Categories</small>
	<a href="{{url('category/create')}}" class="btn btn-info pull-right">
		Add a new category
	</a>
</h1>
<!-- /.row -->	
<div class="row">
	<div class="col-lg-12">
		<div class="table-responsive">
			<table class="table table-hover">
				<thead>
					<tr>
						<th>ID</th>
						<th>Category Name</th>
						<th>Parent</th>
						<th>&nbsp;</th>
						<th>&nbsp;</th>
						<th>&nbsp;</th>
					</tr>
				</thead>
				<tbody>
				@foreach ($categories as $key => $category)
					<tr>
						<th scope="row">{{ $category->id }}</th>
						<td>{{ $category->name }}</td>
						<td>{{ $category->parent_id }}</td>
						<td>
							<a href="{{url('category/'.$category->id)}}">
								<span class="glyphicon glyphicon-eye-open"></span> Open
							</a>
						</td>
						<td>
							<a href="{{url('category/'.$category->id.'/edit')}}">
								<span class="glyphicon glyphicon-edit"></span> Edit
							</a>
						</td>
						<td>
							<a href="{{url('category/'.$category->id.'/delete')}}">
								<span class="glyphicon glyphicon-remove"></span> Delete
							</a>
						</td>
					</tr>
				@endforeach
				</tbody>
			</table>
		</div>	
	</div>
</div>

<div class="row">
	<div class="col-lg-12">
		{{ $categories->links() }}
	</div>
</div>
@stop